import { service as request } from '@/utils/request_web'

// 设计表格填报
export function createTableReport(data) {
  return request({
    url: `/Question/formreport/`,
    method: 'post',
    data: data
  })
}
// 获取表格 id
export function getTable(id) {
  return request({
    url: `/Question/formreport/`,
    method: 'get',
    params: id
  })
}
// 删除表格 id
export function delTable(id) {
  return request({
    url: `/Question/formreport/${id}/`,
    method: 'delete'
  })
}
// 填写表单
export function postTableReport(data) {
  return request({
    url: `/Question/add_form_record/`,
    method: 'post',
    data: data
  })
}
// 获取表格记录 id
export function getTableRecord(id) {
  return request({
    url: `/Question/FormRecordStatis`,
    method: 'get',
    params: id
  })
}
// 删除表格记录 uuid : Array
export function postDelTableRecordByUuid(data) {
  return request({
    url: `/Question/delete_form_record/`,
    method: 'post',
    data: data
  })
}
// 创建问卷
export function createQuestion(data) {
  return request({
    url: `/Question/question/`,
    method: 'post',
    data: data
  })
}
// 删除问卷 id
export function delQuestion(id) {
  return request({
    url: `/Question/question/${id}/`,
    method: 'delete'
  })
}
// 获取问卷 id
export function getQuestion(id) {
  return request({
    url: `/Question/question/`,
    method: 'get',
    params: id
  })
}
// 获取问卷记录 id
export function getQuestionRcord(question) {
  return request({
    url: `/Question/questionRcord`,
    method: 'get',
    params: { question }
  })
}
// 填写问卷
export function postQuestion(data) {
  return request({
    url: `/Question/questionRcord/`,
    method: 'post',
    data: data
  })
}
